/*河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
*/
package cn.javaxc.system.action.system;
import java.io.*;
import java.util.*;
import java.sql.*;
import cn.javaxc.model.base.SQL;
import cn.javaxc.model.base.SQLList;
import cn.javaxc.model.base.SQLMap;
import cn.javaxc.model.base.SQLParam;
import cn.javaxc.model.page.BatisPage;
import cn.javaxc.mvcwork.controller.web.TreeBean;
import cn.javaxc.mvcwork.util.common.CommonUtil;
import cn.javaxc.mvcwork.util.common.MapListUtil;
import cn.javaxc.mvcwork.util.helper.FrameHelper;
import cn.javaxc.mvcwork.util.helper.TreeTableHelper;
import org.springframework.beans.factory.annotation.Autowired;
import cn.javaxc.system.action.base.BaseAction;
import cn.javaxc.system.mapper.system.WorkFlowConfigurationItemMapper;
public class WorkFlowConfigurationItem extends BaseAction
{
    @Autowired(required=false)
	private WorkFlowConfigurationItemMapper mapper;
    /**
    配置工作流项
    */
    
    public Map workFlowConfigurationItem() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        TreeBean tb;
        
        SQLList<SQLMap> parent=mapper.parent(params);
        SQLMap parent_emt=parent.getExistfirst();
        result.put("parent", parent_emt);
        
        
        tb = createTreeBean("l_firm_treecols");
        tb.setPrefix("img");
        tb.setPid(parent);
        SQLList<SQLMap> l_firm=mapper.l_firm(params);
        l_firm = l_firm.buildTree(tb,tb.getPid());
        result.put("l_firm", l_firm);
        
        
        SQLList<SQLMap> s_role=mapper.s_role(params);
        result.put("s_role", s_role);
        
        
        SQLList<SQLMap> UserList=mapper.UserList(params);
        result.put("UserList", UserList);
        
        
        SQLList<SQLMap> steps=mapper.steps(params);
        result.put("steps", steps);
        
        return result;
    }
    /**
    选择子流程
    */
    
    public Map lowerWorkFlowChoice() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        TreeBean tb;
        
        tb = createTreeBean("s_flow_treecols");
        SQLList<SQLMap> s_flow=mapper.s_flow(params);
        s_flow = s_flow.buildTree(tb,tb.getPid());
        result.put("s_flow", s_flow);
        
        
        params.def("CMCLASSID",null);
        SQLList<SQLMap> s_flow_list=mapper.s_flow_list(params);
        result.put("s_flow_list", s_flow_list);
        
        
        
        return result;
    }
    /**
    增加子流程
    */
    
    public Map lowerWorkFlowAdd() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_flowwork=mapper.s_flowwork(params);
        SQLMap s_flowwork_emt=s_flowwork.getExistfirst();
        result.put("s_flowwork", s_flowwork_emt);
        
        
        params.def("CMID","-1");
        params.def("CMID1",-1);
        SQLList<SQLMap> s_parent=mapper.s_parent(params);
        SQLMap s_parent_emt=s_parent.getExistfirst();
        result.put("s_parent", s_parent_emt);
        
        return result;
    }
    /**
    选择岗位人员
    */
    
    public Map stationManChoice() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_type=mapper.s_type(params);
        SQLMap s_type_emt=s_type.getExistfirst();
        result.put("s_type", s_type_emt);
        
        
        SQLList<SQLMap> l_role=mapper.l_role(params,pagination);
        l_role.setPagedListInfo(pagination);
        result.put("l_role", l_role);
        
        return result;
    }
    /**
    配置工作流项修改
    */
    
    public Map workFlowConfigurationItemSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        for (SQLMap emt:hqlBean.getTableElements("file_type_set")){
            params=new SQLParam(request,emt.getMap());
            mapper.u_p(params);
        }
        
        return result;
    }
    /**
    增加子流程修改
    */
    
    public Map lowerWorkFlowAddSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        params.def("CMID7",-1);
        int u_plan = mapper.u_plan(params);
        result.put("u_plan", u_plan);
        
        return result;
    }
}